##############################################################################
#
# XBMC Zone Installer - Plugin for XBMC
# http://www.xbmczone.com
#
# Version 2.1
# 
# Coding by Dan Dar3 
# http://dandar3.blogspot.com
#
#
# Credits:
#   * XBMC Zone                [http://xbmczone.com]
#
# Changes:
#
#  v2.1
#  - display add-on version & date in the list (+ sort)
#
#  v2.0
#  - use data from XML feeds (instead of parsing the HTML pages);
#  - new add-on info dialog before installation;
#  - display add-ons in categories;
#
#  v1.2
#  - not showing add-ons with HTML tags in description;
#
#  v1.1
#  - use new "special://" paths if newer XBMC build (thanks to queeup);
#

# 
# Constants
#
__plugin__  = "XBMC Zone Installer"
__author__  = "Dan Dar3"
__url__     = "http://dandar3.blogspot.com"
__date__    = "22 May 2009"
__version__ = "2.1"


#
# Imports
#
import os
import sys

LIB_DIR = xbmc.translatePath( os.path.join( os.getcwd(), 'resources', 'lib' ) )
sys.path.append (LIB_DIR) 

#
# Main block
#

# Plugin categories
if ( "action=plugin-categories" in sys.argv[ 2 ] ):
	import xbmczone_plugin_categories as plugin
	plugin.Main()

# Plugin list
elif ( "action=plugin-list" in sys.argv[ 2 ] ):
	import xbmczone_plugin_list       as plugin
	plugin.Main()

# Plugin info
elif ( "action=plugin-info" in sys.argv[ 2 ] ):
	import xbmczone_addon_info        as plugin
	gui = plugin.GUI( "xbmczone_addon_info.xml", os.getcwd(), "default" )
	del gui
	
# Script categories
elif ( "action=script-categories" in sys.argv[ 2 ] ):
	import xbmczone_script_categories as plugin
	plugin.Main()

# Script list
elif ( "action=script-list" in sys.argv[ 2 ] ):
	import xbmczone_script_list       as plugin
	plugin.Main()

# Script info
elif ( "action=script-info" in sys.argv[ 2 ] ):
	import xbmczone_addon_info        as plugin
	gui = plugin.GUI( "xbmczone_addon_info.xml", os.getcwd(), "default" )
	del gui
	
# Plugin/Script install
elif ( "action=download-install" in sys.argv[ 2 ] ):
	import xbmczone_download_install  as plugin
	plugin.Main()
	
# Latest/Plugins Edit by Shannon
elif ("action=latest-addons" in sys.argv[ 2 ] ):
	import xbmczone_latest_addons as plugin
	plugin.Main()
	
# Main categories (plugin/scripts)
else:
	import xbmczone_main              as plugin
	plugin.Main()

